package com.huirui.server.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import lombok.Data;


/**
 * 品牌DTO（数据传输对象）
 * 用于品牌新增/修改接口的请求参数
 */
@Data
@Schema(name = "BrandDto", description = "品牌数据传输对象（新增/修改品牌时使用）")
public class BrandDto {

    @Schema(
            description = "品牌ID",
            example = "1001",
            nullable = true,
            hidden = false // 默认为false，无需隐藏时可省略
    )
    private Long id; // 新增时无需传，修改时必传（可结合接口单独控制）

    @NotBlank(message = "品牌名称不能为空") // 配合@Validated做参数校验
    @Schema(
            description = "品牌名称",
            example = "华为",
            nullable = false,
            minLength = 2,
            maxLength = 50,
            requiredMode = Schema.RequiredMode.REQUIRED // 明确标记为必填项
    )
    private String brandName;

    @Schema(
            description = "品牌简介",
            example = "全球领先的ICT基础设施和智能终端提供商",
            nullable = true,
            maxLength = 500
    )
    private String brandProfile; // 可选字段

    @NotNull(message = "品牌权重不能为空")
    @PositiveOrZero(message = "品牌权重必须为非负整数")
    @Schema(
            description = "品牌权重（用于排序，数值越大越靠前）",
            example = "99",
            nullable = false,
            minimum = "0",
            requiredMode = Schema.RequiredMode.REQUIRED
    )
    private Long brandWeight;

    @NotNull(message = "品牌图片ID不能为空")
    @Schema(
            description = "品牌图片ID（关联文件存储的图片ID）",
            example = "2003",
            nullable = false,
            minimum = "0",
            requiredMode = Schema.RequiredMode.REQUIRED
    )
    private String brandImage;
}
